home *** CD-ROM | disk | FTP | other *** search
- // Copyright (c)1995 Ray Dream, Inc. All Rights Reserved.
- /*$Id: COMLINK.h 1.3 1996/08/08 21:19:39 Damien Exp $*/
-
- //
- // COM Example of Motion Link
- //
-
- #ifndef __COMLINK__
- #define __COMLINK__
-
- #ifndef __I3DEXLNK__
- #include "I3DExLnk.h"
- #endif
-
- // define the ScrewLink CLSID
- // {D87962A0-F1ED-11ce-A4F7-0000E202D5A5}
- DEFINE_GUID(CLSID_ScrewLink,0xd87962a0,0xf1ed,0x11ce,0xa4,0xf7,0x0,0x0,0xe2,0x2,0xd5,0xa5);
-
-
- #define ID(a,b,c,d) ((((long)(a))<<24)+(((long)(b))<<16)+(((long)(c))<<8)+(((long)(d))))
- #define kAxisX (long)1
- #define kAxisY (long)2
- #define kAxisZ (long)3
-
-
- typedef struct ScrewLinkData {
- long fAxis; // ID of the axis (AXEX AXEY or AXEZ)
- NUM3D fStep; // Step of the screw (1 turn -> translation of fStep)
- NUM3D fFreedomValue;
- } ScrewLinkData;
-
-
- // ScrewLink Object :
- #undef INTERFACE
- #define INTERFACE ScrewLink
- class ScrewLink : public I3DExMotionLink {
- public :
- ScrewLink();
- ~ScrewLink();
-
- // IUnknown Interface :
- STDMETHODIMP QueryInterface(THIS_ REFIID riid, LPVOID* ppvObj);
- STDMETHODIMP_(ULONG) AddRef(THIS);
- STDMETHODIMP_(ULONG) Release(THIS);
-
- // I3DExtension method :
- STDMETHODIMP_(I3DExtension*) Clone(THIS);
- STDMETHODIMP ShellUtilitiesInit(THIS_ IShUtilities* shellUtilities);
-
- // I3DExDataExchanger methods :
- STDMETHODIMP_(ExtensionDataMap*) GetExtensionDataMap(THIS);
- STDMETHODIMP_(void*) GetExtensionDataBuffer(THIS);
- STDMETHODIMP ExtensionDataChanged(THIS);
- STDMETHODIMP HandleEvent(THIS_ ULONG sourceID);
- STDMETHODIMP_(short) GetResID(THIS);
-
- // I3DExMotionLink methods
- STDMETHODIMP_(short) GetNbrFreedom(THIS);
- STDMETHODIMP IncrementFreedomValue(THIS_ short index, NUM3D* increment);
- STDMETHODIMP GetFreedomRange(THIS_ short index, NUM3D* min, NUM3D* max);
- STDMETHODIMP GetTransform(THIS_ TRANSFORM3D* transform);
- STDMETHODIMP GetTransformPartialDerivate(THIS_ short index, TRANSFORM3D* transform);
-
- private :
- ULONG fCRef; // reference Counter
- ScrewLinkData fData; // Screw Link Data
- };
-
-
- #endif
-